package design.Facade;

/**
 * Created by looper on 2017/8/16.
 */
public class Computer {
  private CPU cpu;
  private Disk disk;
  private Memory memory;

  public Computer(){
    this.cpu = new CPU();
    this.memory = new Memory();
    this.disk = new Disk();
  }

  public void startUp() {
    System.out.println("电脑开机准备");
    cpu.startUp();
    memory.startUp();
    disk.startUp();
    System.out.println("电脑开机成功");
  }

  public void shutdown() {
    System.out.println("电脑准备关机");
    cpu.shutdown();
    memory.shutdown();
    disk.shutdown();
    System.out.println("电脑已关机");
  }
}
